#!/bin/sh

if [ $# -eq 0 ]; then 
	t_today=`da +0`
elif [[ $# -eq 1 ]]; then
		t_today=`da $1`
else
	exit -1
fi

cd ~/workshop/gitee/yumo

find . |grep $t_today |xargs subl

find . |grep $t_today |xargs cat >`date -I`.md



echo "% 宇墨小课堂" > tmp.md
echo "% 第三同读" >> tmp.md
echo "% " $t_today >> tmp.md
echo "" >> tmp.md

echo "[成语](./y/) [英语](./e/) [几何原本](./m/)  [计算机](./i/)" >>tmp.md

echo "" >>tmp.md

sed -e "/^%.*/d" `date -I`.md | sed -e "/.*audio*/d" >>tmp.md


pandoc -s  tmp.md -o ~/workshop/hbaolong.github.io/yumo/index.html

rm -f tmp.md
rm -f `date -I`.md

